package collections;
import java.util.*;

class Doggie {
	public String name;
	Doggie(String n) { name = n; }
}

public class ItTest {
	public static void main(String[] args) {
		List<Doggie> d = new ArrayList<Doggie>();
		Doggie Doggie = new Doggie("aiko");
		d.add(Doggie);
		d.add(new Doggie("clover"));
		d.add(new Doggie("magnolia"));
		Iterator<Doggie> i3 = d.iterator();
		while(i3.hasNext()) {
			Doggie d2 = i3.next();
			System.out.println(d2.name);
		}
		System.out.println("size " + d.size());
		System.out.println("get1 " + d.get(1).name);
		System.out.println("aiko " + d.indexOf(Doggie));
		d.remove(2);
		Object[] oa = d.toArray();
		for(Object o : oa) {
			Doggie d2 = (Doggie)o;
			System.out.println("oa " + d2.name);
		}
	}
}
